#!/usr/bin/env perl

use utf8;
use strict;

my $total = 0;
my $valid = 0;
my %count;


while(<>){
	foreach(split){
		$total ++;
		next if /\W/;
		$valid ++;
		$count{$_} ++;
	}
}

print "Total things = $total, valid words = $valid\n";
foreach my $word (sort keys %count){
	print "$word was seen $count{$word} times.\n";
}
